/**
 * @NApiVersion 2.x
 * @NScriptType Restlet
 */
define(['N/record', 'N/error', 'N/search', 'N/runtime', './report_builder_amazon'], function (record, error, search, runtime, amazon) {
    function post(context) {
        log.debug('request', context);
        var builder;
        var response;
        var platform = context.platform.toUpperCase();
        if (platform === "AMAZON") {
            builder = amazon;
        } else {
            return "ERROR:没有对应的平台:" + platform;
        }
        response = builder.handleReport(context);
        log.debug('response', response);
        return response;
    }

    return {
        post: post
    };
});